import Ques from './QuestionConst'
export default {
  convertType (type) {
    if (typeof type === 'number') {
      switch (type) {
        case Ques.TYPE.SINGLE_INT:return Ques.TYPE.SINGLE_STR
        case Ques.TYPE.MULTI_INT:return Ques.TYPE.MULTI_STR
      }
    }

    if (typeof type === 'string') {
      switch (type) {
        case Ques.TYPE.SINGLE_STR:return Ques.TYPE.SINGLE_INT
        case Ques.TYPE.MULTI_STR:return Ques.TYPE.MULTI_INT
      }
    }
  },
  convertLevel (level) {
    if (typeof level === 'number') {
      switch (level) {
        case Ques.LEVEL.SIMPLE_INT:return Ques.LEVEL.SIMPLE_STR
        case Ques.LEVEL.NORMAL_INT:return Ques.LEVEL.NORMAL_STR
        case Ques.LEVEL.COMPLEX_INT:return Ques.LEVEL.COMPLEX_STR
      }
    }
    if (typeof level === 'string') {
      switch (level) {
        case Ques.LEVEL.SIMPLE_STR:return Ques.LEVEL.SIMPLE_INT
        case Ques.LEVEL.NORMAL_STR:return Ques.LEVEL.NORMAL_INT
        case Ques.LEVEL.COMPLEX_STR:return Ques.LEVEL.COMPLEX_INT
      }
    }
  },
  ...Ques
}
